home *** CD-ROM | disk | FTP | other *** search
/ FishMarket 1.0 / FishMarket v1.0.iso / fishies / 551-575 / disk_556 / scheme2c / scheme-src.lzh / scrt / apply.c next >
C/C++ Source or Header  |  1991-10-11  |  23KB  |  482 lines

  1. /* SCHEME->C */
  2.  
  3. /*              Copyright 1989 Digital Equipment Corporation
  4.  *                         All Rights Reserved
  5.  *
  6.  * Permission to use, copy, and modify this software and its documentation is
  7.  * hereby granted only under the following terms and conditions.  Both the
  8.  * above copyright notice and this permission notice must appear in all copies
  9.  * of the software, derivative works or modified versions, and any portions
  10.  * thereof, and both notices must appear in supporting documentation.
  11.  *
  12.  * Users of this software agree to the terms and conditions set forth herein,
  13.  * and hereby grant back to Digital a non-exclusive, unrestricted, royalty-free
  14.  * right and license under any changes, enhancements or extensions made to the
  15.  * core functions of the software, including but not limited to those affording
  16.  * compatibility with other hardware or software environments, but excluding
  17.  * applications which incorporate this software.  Users further agree to use
  18.  * their best efforts to return to Digital any such changes, enhancements or
  19.  * extensions that they make and inform Digital of noteworthy uses of this
  20.  * software.  Correspondence should be provided to Digital at:
  21.  * 
  22.  *                       Director of Licensing
  23.  *                       Western Research Laboratory
  24.  *                       Digital Equipment Corporation
  25.  *                       100 Hamilton Avenue
  26.  *                       Palo Alto, California  94301  
  27.  * 
  28.  * This software may be distributed (but not offered for sale or transferred
  29.  * for compensation) to third parties, provided such third parties agree to
  30.  * abide by the terms and conditions of this notice.  
  31.  * 
  32.  * THE SOFTWARE IS PROVIDED "AS IS" AND DIGITAL EQUIPMENT CORP. DISCLAIMS ALL
  33.  * WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF
  34.  * MERCHANTABILITY AND FITNESS.   IN NO EVENT SHALL DIGITAL EQUIPMENT
  35.  * CORPORATION BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
  36.  * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
  37.  * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS
  38.  * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
  39.  * SOFTWARE.
  40. */
  41.  
  42. /* This module defines the APPLY and UNKNOWNCALL functions.  APPLY is as
  43.    defined in Revised**3 and UNKNOWNCALL is a variant of APPLY which is used
  44.    by the compiler to call unknown functions.
  45. */
  46.  
  47. /* External declarations */
  48.  
  49. #include "objects.h"
  50. #include "scinit.h"
  51. #include "heap.h"
  52. #include "apply.h"
  53. #include <varargs.h>
  54.  
  55. /* Data structures used by UNKNOWNCALL.  These values must be pushed on the
  56.    stack and then restored by interrupt handlers or when calling finalization
  57.    procedures.
  58. */
  59.  
  60. TSCP  sc_unknownproc[ 4 ];    /* Procedure pointers */
  61.  
  62. int  sc_unknownargc;        /* Procedure argument count */
  63.  
  64. TSCP  sc_arg[MAXARGS];        /* Array for the required arguments */
  65.  
  66. /* APPLY as defined in Revised**3.  It expects a procedure and an argument
  67.    list.  It returns the result of applying that procedure to the arguments.
  68. */
  69.  
  70. TSCP  sc_apply_2dtwo( proc, argl )
  71.    TSCP proc, argl;
  72. {
  73.     int  i;
  74.     int  req;        /* # of required arguments */
  75.     int  opt;           /* true iff required arguments */
  76.     TSCP  arg[MAXARGS];    /* argument array */
  77.     TSCP  closure;        /* closure pointer */
  78.     SCP  utproc;        /* untagged version of tproc */    
  79.     SCP  utargl; 
  80.  
  81.     utproc = T_U( proc );
  82.     if ((TSCPTAG( proc ) != EXTENDEDTAG) ||
  83.         (utproc->procedure.tag != PROCEDURETAG))
  84.        sc_error( "APPLY", "Argument is not a PROCEDURE ~s", 1, proc );
  85.     req = utproc->procedure.required;
  86.     opt = utproc->procedure.optional;
  87.     i = 0;
  88.     while  ((i < req) && (TSCPTAG( argl ) == PAIRTAG)) {
  89.        utargl = T_U( argl );
  90.        arg[ i++ ] = utargl->pair.car;
  91.        argl = utargl->pair.cdr;
  92.     }
  93.     if  (i < req)
  94.        sc_error( "APPLY", "PROCEDURE requires ~s arguments, ~s supplied",
  95.               2, C_FIXED( req ), C_FIXED( i ) );
  96.     if  (opt)
  97.        closure = utproc->procedure.closure;
  98.     else  {
  99.        if  (argl != EMPTYLIST)
  100.           sc_error( "APPLY", "PROCEDURE accepts only ~s arguments",
  101.                      1, C_FIXED( req ) );
  102.        argl = utproc->procedure.closure;
  103.     }
  104.     switch (req) {
  105.            case  0: return( (*utproc->procedure.code)
  106.                        ( argl, closure  ) );
  107.            case  1: return( (*utproc->procedure.code)
  108.                        ( arg[0], argl, closure ) );
  109.            case  2: return( (*utproc->procedure.code)
  110.                                         ( arg[0], arg[1], argl, closure ) );
  111.            case  3: return( (*utproc->procedure.code)
  112.                                         ( arg[0], arg[1], arg[2], argl,
  113.                       closure ) );
  114.            case  4: return( (*utproc->procedure.code)
  115.                                         ( arg[0], arg[1], arg[2], arg[3],
  116.                                           argl, closure ));
  117.            case  5: return( (*utproc->procedure.code)
  118.                                         ( arg[0], arg[1], arg[2], arg[3],
  119.                                           arg[4], argl, closure ) );
  120.            case  6: return( (*utproc->procedure.code)
  121.                                         ( arg[0], arg[1], arg[2], arg[3],
  122.                                           arg[4], arg[5], argl, closure ) );
  123.            case  7: return( (*utproc->procedure.code)
  124.                                         ( arg[0], arg[1], arg[2], arg[3],
  125.                                           arg[4], arg[5], arg[6], argl,
  126.                       closure ) );
  127.            case  8: return( (*utproc->procedure.code)
  128.                                         ( arg[0], arg[1], arg[2], arg[3],
  129.                                           arg[4], arg[5], arg[6], arg[7],
  130.                                           argl, closure ) );
  131.            case  9: return( (*utproc->procedure.code)
  132.                                         ( arg[0], arg[1], arg[2], arg[3],
  133.                                           arg[4], arg[5], arg[6], arg[7],
  134.                                           arg[8], argl, closure ) );
  135.            case 10: return( (*utproc->procedure.code)
  136.                                         ( arg[0], arg[1], arg[2], arg[3],
  137.                                           arg[4], arg[5], arg[6], arg[7],
  138.                                           arg[8], arg[9], argl, closure ) );
  139.            case 11: return( (*utproc->procedure.code)
  140.                                         ( arg[0], arg[1], arg[2], arg[3],
  141.                                           arg[4], arg[5], arg[6], arg[7],
  142.                                           arg[8], arg[9], arg[10], argl,
  143.                       closure ) );
  144.            case 12: return( (*utproc->procedure.code)
  145.                                         ( arg[0], arg[1], arg[2], arg[3],
  146.                                           arg[4], arg[5], arg[6], arg[7],
  147.                                           arg[8], arg[9], arg[10], arg[11],
  148.                                           argl, closure ) );
  149.            case 13: return( (*utproc->procedure.code)
  150.                                         ( arg[0], arg[1], arg[2], arg[3],
  151.                                           arg[4], arg[5], arg[6], arg[7],
  152.                                           arg[8], arg[9], arg[10], arg[11],
  153.                                           arg[12], argl, closure ) );
  154.            case 14: return( (*utproc->procedure.code)
  155.                                         ( arg[0], arg[1], arg[2], arg[3],
  156.                                           arg[4], arg[5], arg[6], arg[7],
  157.                                           arg[8], arg[9], arg[10], arg[11],
  158.                                           arg[12], arg[13], argl, closure ) );
  159.            case 15: return( (*utproc->procedure.code)
  160.                                         ( arg[0], arg[1], arg[2], arg[3],
  161.                                           arg[4], arg[5], arg[6], arg[7],
  162.                                           arg[8], arg[9], arg[10], arg[11],
  163.                                           arg[12], arg[13], arg[14], argl,
  164.                       closure ) );
  165.            case 16: return( (*utproc->procedure.code)
  166.                                         ( arg[0], arg[1], arg[2], arg[3],
  167.                                           arg[4], arg[5], arg[6], arg[7],
  168.                                           arg[8], arg[9], arg[10], arg[11],
  169.                                           arg[12], arg[13], arg[14], arg[15],
  170.                                           argl, closure ) );
  171. #if (MAXARGS >= 17)
  172.            case 17: return( (*utproc->procedure.code)
  173.                                         ( arg[0], arg[1], arg[2], arg[3],
  174.                                           arg[4], arg[5], arg[6], arg[7],
  175.                                           arg[8], arg[9], arg[10], arg[11],
  176.                                           arg[12], arg[13], arg[14], arg[15],
  177.                                           arg[16], argl, closure ) );
  178. #endif
  179. #if (MAXARGS >= 18)
  180.            case 18: return( (*utproc->procedure.code)
  181.                                         ( arg[0], arg[1], arg[2], arg[3],
  182.                                           arg[4], arg[5], arg[6], arg[7],
  183.                                           arg[8], arg[9], arg[10], arg[11],
  184.                                           arg[12], arg[13], arg[14], arg[15],
  185.                                           arg[16], arg[17], argl, closure ) );
  186. #endif
  187. #if (MAXARGS >= 19)
  188.            case 19: return( (*utproc->procedure.code)
  189.                                         ( arg[0], arg[1], arg[2], arg[3],
  190.                                           arg[4], arg[5], arg[6], arg[7],
  191.                                           arg[8], arg[9], arg[10], arg[11],
  192.                                           arg[12], arg[13], arg[14], arg[15],
  193.                                           arg[16], arg[17], arg[18], argl,
  194.                       closure ) );
  195. #endif
  196. #if (MAXARGS >= 20)
  197.            case 20: return( (*utproc->procedure.code)
  198.                                         ( arg[0], arg[1], arg[2], arg[3],
  199.                                           arg[4], arg[5], arg[6], arg[7],
  200.                                           arg[8], arg[9], arg[10], arg[11],
  201.                                           arg[12], arg[13], arg[14], arg[15],
  202.                                           arg[16], arg[17], arg[18], arg[19],
  203.                       argl, closure ) );
  204. #endif
  205. #if (MAXARGS >= 21)
  206.            case 21: return( (*utproc->procedure.code)
  207.                                         ( arg[0], arg[1], arg[2], arg[3],
  208.                                           arg[4], arg[5], arg[6], arg[7],
  209.                                           arg[8], arg[9], arg[10], arg[11],
  210.                                           arg[12], arg[13], arg[14], arg[15],
  211.                                           arg[16], arg[17], arg[18], arg[19],
  212.                       arg[20], argl, closure ) );
  213. #endif
  214. #if (MAXARGS >= 22)
  215.            case 22: return( (*utproc->procedure.code)
  216.                                         ( arg[0], arg[1], arg[2], arg[3],
  217.                                           arg[4], arg[5], arg[6], arg[7],
  218.                                           arg[8], arg[9], arg[10], arg[11],
  219.                                           arg[12], arg[13], arg[14], arg[15],
  220.                                           arg[16], arg[17], arg[18], arg[19],
  221.                       arg[20], arg[21], argl, closure ) );
  222. #endif
  223. #if (MAXARGS >= 23)
  224.            case 23: return( (*utproc->procedure.code)
  225.                                         ( arg[0], arg[1], arg[2], arg[3],
  226.                                           arg[4], arg[5], arg[6], arg[7],
  227.                                           arg[8], arg[9], arg[10], arg[11],
  228.                                           arg[12], arg[13], arg[14], arg[15],
  229.                                           arg[16], arg[17], arg[18], arg[19],
  230.                       arg[20], arg[21], arg[22], argl,
  231.                       closure ) );
  232. #endif
  233. #if (MAXARGS >= 24)
  234.            case 24: return( (*utproc->procedure.code)
  235.                                         ( arg[0], arg[1], arg[2], arg[3],
  236.                                           arg[4], arg[5], arg[6], arg[7],
  237.                                           arg[8], arg[9], arg[10], arg[11],
  238.                                           arg[12], arg[13], arg[14], arg[15],
  239.                                           arg[16], arg[17], arg[18], arg[19],
  240.                       arg[20], arg[21], arg[22], arg[23],
  241.                       argl, closure ) );
  242. #endif
  243. #if (MAXARGS >= 25)
  244.            case 25: return( (*utproc->procedure.code)
  245.                                         ( arg[0], arg[1], arg[2], arg[3],
  246.                                           arg[4], arg[5], arg[6], arg[7],
  247.                                           arg[8], arg[9], arg[10], arg[11],
  248.                                           arg[12], arg[13], arg[14], arg[15],
  249.                                           arg[16], arg[17], arg[18], arg[19],
  250.                       arg[20], arg[21], arg[22], arg[23],
  251.                       arg[24], argl, closure ) );
  252. #endif
  253.     }
  254. }
  255.  
  256. /* UNKNOWNCALL is a variant of apply where the function's arguments are
  257.    are passed as arguments to the function.  Before the call, the procedure
  258.    pointer is placed in SC_UNKNOWNPROC[ 1 ], and the argument count is placed
  259.    in SC_UNKNOWNARGC.  This procedure is only entered, when there is an error
  260.    in the call, or the procedure takes a variable number of arguments.
  261. */
  262.  
  263. TSCP  sc_unknowncall( va_alist )
  264.    va_dcl
  265. {
  266.     va_list  argl;            /* List of arguments on stack */
  267.     int  req;            /* # of required arguments */
  268.     int  i;                /* Loop index */
  269.     TSCP  optl;            /* Optional argument list */
  270.     TSCP  tail;            /* Tail of optional argument list */
  271.     SCP  utproc;            /* Untagged version of proc */
  272.  
  273.     va_start( argl );
  274.     utproc = T_U( sc_unknownproc[ 1 ] );
  275.         if ((TSCPTAG( sc_unknownproc[ 1 ] ) != EXTENDEDTAG) ||
  276.             (utproc->procedure.tag != PROCEDURETAG))
  277.            sc_error( "APPLY", "Argument is not a PROCEDURE: ~s", 1,
  278.              sc_unknownproc[ 1 ] );
  279.         req = utproc->procedure.required;
  280.     if  ((sc_unknownargc < req) ||
  281.          ((utproc->procedure.optional == 0) && (sc_unknownargc != req)))
  282.        sc_error( "APPLY", "PROCEDURE requires ~s arguments, ~s supplied",
  283.               2, C_FIXED( req ), C_FIXED( sc_unknownargc ) );
  284.     for  (i = 0; i < req; i++)  sc_arg[ i ] = va_arg( argl, TSCP );
  285.     optl = EMPTYLIST;
  286.     if  (i++ < sc_unknownargc)  {
  287.        tail = (optl = sc_cons( va_arg( argl, TSCP ), EMPTYLIST ));
  288.        while  (i++ < sc_unknownargc)
  289.           tail = (TP_U( tail )->pair.cdr = sc_cons( va_arg( argl, TSCP ),
  290.                             EMPTYLIST ));
  291.     }   
  292.     switch (req) {
  293.            case  0: return( (*utproc->procedure.code)
  294.                        ( optl, utproc->procedure.closure ) );
  295.            case  1: return( (*utproc->procedure.code)
  296.                        ( sc_arg[0], optl,
  297.                       utproc->procedure.closure ) );
  298.            case  2: return( (*utproc->procedure.code)
  299.                                         ( sc_arg[0], sc_arg[1], optl,
  300.                       utproc->procedure.closure ) );
  301.            case  3: return( (*utproc->procedure.code)
  302.                                         ( sc_arg[0], sc_arg[1], sc_arg[2],
  303.                       optl, utproc->procedure.closure ) );
  304.            case  4: return( (*utproc->procedure.code)
  305.                                         ( sc_arg[0], sc_arg[1], sc_arg[2],
  306.                       sc_arg[3], optl,
  307.                       utproc->procedure.closure ));
  308.            case  5: return( (*utproc->procedure.code)
  309.                                         ( sc_arg[0], sc_arg[1], sc_arg[2],
  310.                       sc_arg[3], sc_arg[4], optl,
  311.                       utproc->procedure.closure ) );
  312.            case  6: return( (*utproc->procedure.code)
  313.                                         ( sc_arg[0], sc_arg[1], sc_arg[2],
  314.                       sc_arg[3], sc_arg[4], sc_arg[5],
  315.                       optl, utproc->procedure.closure ) );
  316.            case  7: return( (*utproc->procedure.code)
  317.                                         ( sc_arg[0], sc_arg[1], sc_arg[2],
  318.                       sc_arg[3], sc_arg[4], sc_arg[5],
  319.                       sc_arg[6], optl,
  320.                       utproc->procedure.closure ) );
  321.            case  8: return( (*utproc->procedure.code)
  322.                                         ( sc_arg[0], sc_arg[1], sc_arg[2],
  323.                       sc_arg[3], sc_arg[4], sc_arg[5],
  324.                       sc_arg[6], sc_arg[7], optl,
  325.                       utproc->procedure.closure ) );
  326.            case  9: return( (*utproc->procedure.code)
  327.                                         ( sc_arg[0], sc_arg[1], sc_arg[2],
  328.                       sc_arg[3], sc_arg[4], sc_arg[5],
  329.                       sc_arg[6], sc_arg[7], sc_arg[8],
  330.                       optl, utproc->procedure.closure ) );
  331.            case 10: return( (*utproc->procedure.code)
  332.                                         ( sc_arg[0], sc_arg[1], sc_arg[2],
  333.                       sc_arg[3], sc_arg[4], sc_arg[5],
  334.                       sc_arg[6], sc_arg[7], sc_arg[8],
  335.                       sc_arg[9], optl,
  336.                       utproc->procedure.closure ) );
  337.            case 11: return( (*utproc->procedure.code)
  338.                                         ( sc_arg[0], sc_arg[1], sc_arg[2],
  339.                       sc_arg[3], sc_arg[4], sc_arg[5],
  340.                       sc_arg[6], sc_arg[7], sc_arg[8],
  341.                       sc_arg[9], sc_arg[10], optl,
  342.                       utproc->procedure.closure ) );
  343.            case 12: return( (*utproc->procedure.code)
  344.                                         ( sc_arg[0], sc_arg[1], sc_arg[2],
  345.                       sc_arg[3], sc_arg[4], sc_arg[5],
  346.                       sc_arg[6], sc_arg[7], sc_arg[8],
  347.                       sc_arg[9], sc_arg[10], sc_arg[11],
  348.                                           optl, utproc->procedure.closure ) );
  349.            case 13: return( (*utproc->procedure.code)
  350.                                         ( sc_arg[0], sc_arg[1], sc_arg[2],
  351.                       sc_arg[3], sc_arg[4], sc_arg[5],
  352.                       sc_arg[6], sc_arg[7], sc_arg[8],
  353.                       sc_arg[9], sc_arg[10], sc_arg[11],
  354.                                           sc_arg[12], optl,
  355.                       utproc->procedure.closure ) );
  356.            case 14: return( (*utproc->procedure.code)
  357.                                         ( sc_arg[0], sc_arg[1], sc_arg[2],
  358.                       sc_arg[3], sc_arg[4], sc_arg[5],
  359.                       sc_arg[6], sc_arg[7], sc_arg[8],
  360.                       sc_arg[9], sc_arg[10], sc_arg[11],
  361.                                           sc_arg[12], sc_arg[13], optl,
  362.                       utproc->procedure.closure ) );
  363.            case 15: return( (*utproc->procedure.code)
  364.                                         ( sc_arg[0], sc_arg[1], sc_arg[2],
  365.                       sc_arg[3], sc_arg[4], sc_arg[5],
  366.                       sc_arg[6], sc_arg[7], sc_arg[8],
  367.                       sc_arg[9], sc_arg[10], sc_arg[11],
  368.                                           sc_arg[12], sc_arg[13], sc_arg[14],
  369.                       optl, utproc->procedure.closure ) );
  370.            case 16: return( (*utproc->procedure.code)
  371.                                         ( sc_arg[0], sc_arg[1], sc_arg[2],
  372.                       sc_arg[3], sc_arg[4], sc_arg[5],
  373.                       sc_arg[6], sc_arg[7], sc_arg[8],
  374.                       sc_arg[9], sc_arg[10], sc_arg[11],
  375.                                           sc_arg[12], sc_arg[13], sc_arg[14],
  376.                       sc_arg[15], optl,
  377.                       utproc->procedure.closure ) );
  378. #if (MAXARGS >= 17)
  379.            case 17: return( (*utproc->procedure.code)
  380.                                         ( sc_arg[0], sc_arg[1], sc_arg[2],
  381.                       sc_arg[3], sc_arg[4], sc_arg[5],
  382.                       sc_arg[6], sc_arg[7], sc_arg[8],
  383.                       sc_arg[9], sc_arg[10], sc_arg[11],
  384.                                           sc_arg[12], sc_arg[13], sc_arg[14],
  385.                       sc_arg[15], sc_arg[16], optl,
  386.                       utproc->procedure.closure ) );
  387. #endif
  388. #if (MAXARGS >= 18)
  389.            case 18: return( (*utproc->procedure.code)
  390.                                         ( sc_arg[0], sc_arg[1], sc_arg[2],
  391.                       sc_arg[3], sc_arg[4], sc_arg[5],
  392.                       sc_arg[6], sc_arg[7], sc_arg[8],
  393.                       sc_arg[9], sc_arg[10], sc_arg[11],
  394.                                           sc_arg[12], sc_arg[13], sc_arg[14],
  395.                       sc_arg[15], sc_arg[16], sc_arg[17],
  396.                       optl, utproc->procedure.closure ) );
  397. #endif
  398. #if (MAXARGS >= 19)
  399.            case 19: return( (*utproc->procedure.code)
  400.                                         ( sc_arg[0], sc_arg[1], sc_arg[2],
  401.                       sc_arg[3], sc_arg[4], sc_arg[5],
  402.                       sc_arg[6], sc_arg[7], sc_arg[8],
  403.                       sc_arg[9], sc_arg[10], sc_arg[11],
  404.                                           sc_arg[12], sc_arg[13], sc_arg[14],
  405.                       sc_arg[15], sc_arg[16], sc_arg[17],
  406.                       sc_arg[18],
  407.                       optl, utproc->procedure.closure ) );
  408. #endif
  409. #if (MAXARGS >= 20)
  410.            case 20: return( (*utproc->procedure.code)
  411.                                         ( sc_arg[0], sc_arg[1], sc_arg[2],
  412.                       sc_arg[3], sc_arg[4], sc_arg[5],
  413.                       sc_arg[6], sc_arg[7], sc_arg[8],
  414.                       sc_arg[9], sc_arg[10], sc_arg[11],
  415.                                           sc_arg[12], sc_arg[13], sc_arg[14],
  416.                       sc_arg[15], sc_arg[16], sc_arg[17],
  417.                       sc_arg[18], sc_arg[19],
  418.                       optl, utproc->procedure.closure ) );
  419. #endif
  420. #if (MAXARGS >= 21)
  421.            case 21: return( (*utproc->procedure.code)
  422.                                         ( sc_arg[0], sc_arg[1], sc_arg[2],
  423.                       sc_arg[3], sc_arg[4], sc_arg[5],
  424.                       sc_arg[6], sc_arg[7], sc_arg[8],
  425.                       sc_arg[9], sc_arg[10], sc_arg[11],
  426.                                           sc_arg[12], sc_arg[13], sc_arg[14],
  427.                       sc_arg[15], sc_arg[16], sc_arg[17],
  428.                       sc_arg[18], sc_arg[19], sc_arg[20],
  429.                       optl, utproc->procedure.closure ) );
  430. #endif
  431. #if (MAXARGS >= 22)
  432.            case 22: return( (*utproc->procedure.code)
  433.                                         ( sc_arg[0], sc_arg[1], sc_arg[2],
  434.                       sc_arg[3], sc_arg[4], sc_arg[5],
  435.                       sc_arg[6], sc_arg[7], sc_arg[8],
  436.                       sc_arg[9], sc_arg[10], sc_arg[11],
  437.                                           sc_arg[12], sc_arg[13], sc_arg[14],
  438.                       sc_arg[15], sc_arg[16], sc_arg[17],
  439.                       sc_arg[18], sc_arg[19], sc_arg[20],
  440.                       sc_arg[21],
  441.                       optl, utproc->procedure.closure ) );
  442. #endif
  443. #if (MAXARGS >= 23)
  444.            case 23: return( (*utproc->procedure.code)
  445.                                         ( sc_arg[0], sc_arg[1], sc_arg[2],
  446.                       sc_arg[3], sc_arg[4], sc_arg[5],
  447.                       sc_arg[6], sc_arg[7], sc_arg[8],
  448.                       sc_arg[9], sc_arg[10], sc_arg[11],
  449.                                           sc_arg[12], sc_arg[13], sc_arg[14],
  450.                       sc_arg[15], sc_arg[16], sc_arg[17],
  451.                       sc_arg[18], sc_arg[19], sc_arg[20],
  452.                       sc_arg[21], sc_arg[22],
  453.                       optl, utproc->procedure.closure ) );
  454. #endif
  455. #if (MAXARGS >= 24)
  456.            case 24: return( (*utproc->procedure.code)
  457.                                         ( sc_arg[0], sc_arg[1], sc_arg[2],
  458.                       sc_arg[3], sc_arg[4], sc_arg[5],
  459.                       sc_arg[6], sc_arg[7], sc_arg[8],
  460.                       sc_arg[9], sc_arg[10], sc_arg[11],
  461.                                           sc_arg[12], sc_arg[13], sc_arg[14],
  462.                       sc_arg[15], sc_arg[16], sc_arg[17],
  463.                       sc_arg[18], sc_arg[19], sc_arg[20],
  464.                       sc_arg[21], sc_arg[22], sc_arg[23],
  465.                       optl, utproc->procedure.closure ) );
  466. #endif
  467. #if (MAXARGS >= 25)
  468.            case 25: return( (*utproc->procedure.code)
  469.                                         ( sc_arg[0], sc_arg[1], sc_arg[2],
  470.                       sc_arg[3], sc_arg[4], sc_arg[5],
  471.                       sc_arg[6], sc_arg[7], sc_arg[8],
  472.                       sc_arg[9], sc_arg[10], sc_arg[11],
  473.                                           sc_arg[12], sc_arg[13], sc_arg[14],
  474.                       sc_arg[15], sc_arg[16], sc_arg[17],
  475.                       sc_arg[18], sc_arg[19], sc_arg[20],
  476.                       sc_arg[21], sc_arg[22], sc_arg[23],
  477.                       sc_arg[24],
  478.                       optl, utproc->procedure.closure ) );
  479. #endif
  480.     }
  481. }
  482.